課程資訊
課程名稱
高等編譯器設計
Advanced Compiler Design 
開課學期
108-2 
授課對象
電機資訊學院  資訊網路與多媒體研究所  
授課教師
廖世偉 
課號
CSIE5054 
課程識別碼
922EU1220 
班次
 
學分
3.0 
全/半年
半年 
必/選修
選修 
上課時間
星期五8,9,10(15:30~18:20) 
上課地點
資105 
備註
本課程以英語授課。與徐慰中合授
總人數上限:55人 
Ceiba 課程網頁
http://ceiba.ntu.edu.tw/1082CSIE5054 
課程簡介影片
 
核心能力關聯
核心能力與課程規劃關聯圖
課程大綱
為確保您我的權利,請尊重智慧財產權及不得非法影印
課程概述

1. Machine learning and scientific computing need a lot of cycles; machines such as GPUs are complex to code. How do we automatically generate efficient code for these machines effectively. (Parallelism and Locality)
2. Can we use program analysis to automatically detect security bugs in programs? (Pointer analysis)
3. How do we automatically manage memory efficiently so users do not have to manage it themselves? (Garbage collection)
4. How do we make high-level programming languages efficient by optimizing the code? (Data-flow analysis)
5. The highest programming language is obviously natural language. Can we program our virtual assistant to perform compound tasks in natural language? We use machine learning techniques to map natural language into formal languages. Note: no prior knowledge in machine learning is needed. (Neural networks, Satisfiability Modulo Theories)

Note: The above shows that the theory, techniques and algorithms in a compiler are applicable to a wide range of problems in software design and development. The goal of this course is to provide students with the theory and techniques in program analysis and optimization. 

課程目標
1. To train students in systems such as AI computing and compilation: You will learn from author of Smart Explorer, Android Virtual Machine and RenderScript Engine (Google).
2. To provide students with the theory and techniques in program analysis and optimization
3. To equip students with the key abstraction skill: Benefitting from Moore's Law, the main abstraction level in Computer Science has shifted higher rapidly. (In comparison, Taiwan's industry has been buried in the hardware, drivers, and benchmarking game.)
4. To help students learn about performance and analysis 
課程要求
1. Algorithms and programming.
2. Problem solving capability. 
預期每週課後學習時數
 
Office Hours
 
指定閱讀
Compilers: Principles, Techniques, and Tools, 2nd Edition
This book is aka Dragon Book.
Aho, Lam, Sethi, and Ullman
Addison-Wesley 2007
ISBN 0-321-48681-1

The course emphasizes Chapter 11 of the Dragon Book, which is related to PhD thesis of Prof. Liao's 20+ years ago. 
參考書目
Advanced Compiler Design and Implementation
Steven Muchnick
Morgan Kaufmann 1997
ISBN 1558603202 
評量方式
(僅供參考)
   
課程進度
週次
日期
單元主題
第1週
2/21 
No class 
第2週
2/28  No class 
第3週
3/06  AI Compilation  
第4週
3/13  1. Parallelization
2. Low-Level Virtual Machine (LLVM): Optimizations 
第5週
3/20  Transforms 
第6週
3/27  1) Introduction
2) Register Allocation 
第7週
4/03  No class 
第8週
4/10  Introduction
Register Allocation
(Virtual Class)
 
第9週
4/17  Code Schedulling
ILP compiling issues (Chapter 10)
 
第10週
4/24  Code Scheduling, global code motion, trace scheduling, speculative code motion, loop scheduling, software pipeling 
第11週
5/01  Dragon Book Chapter 10 and review for midterm (Professor Liao) 
第12週
5/08  Data and Instruction cache prefetching
Midterm Exam (Take Home) 
第13週
5/15  Instruction Cache Prefetching

Auto-Vectorization 
第14週
5/22  Auto-Vectorization 
第15週
5/29  ML guided compiler optimizations
AI Compilers
Guest Speaker (Skymizer)
Lecture Topic: Compiler Theories for Deep Learning Accelerators. 
第16週
6/05  Software Pipelining and its application etc. (after final) 
第17週
6/12  Dataflow Compiler: Locality Optimizations. Boosting with Interactive Optimization